<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<meta http-equiv="Content-Language" content="en-us">
	<title>Xtext-Web Entities Example</title>
	<link rel="stylesheet" type="text/css" href="orion/code_edit/built-codeEdit.css" />
	<link rel="stylesheet" type="text/css" href="xtext/@xtext-version-placeholder@/xtext-orion.css" />
	<link rel="stylesheet" type="text/css" href="style.css" />
	<script src="webjars/requirejs/2.3.6/require.min.js"></script>
	<script type="text/javascript">
		var baseUrl = window.location.pathname;
		var fileIndex = baseUrl.indexOf("orion-entities-static.html");
		if (fileIndex > 0)
			baseUrl = baseUrl.slice(0, fileIndex)
		require.config({
			baseUrl: baseUrl,
			paths: {
				"text": "webjars/requirejs-text/2.0.15/text",
				"jquery": "webjars/jquery/3.6.0/jquery.min",
				"xtext/xtext-orion": "xtext/@xtext-version-placeholder@/xtext-orion",
			}
		});
		require(["orion/code_edit/built-codeEdit-amd"], function() {
			require(["xtext/xtext-orion"], function(xtext) {
				xtext.createEditor({syntaxDefinition: "xtext/entities-syntax", baseUrl: baseUrl,});
			});
		});
	</script>
</head>
<body>

<div class="container">
	<div class="xtext-editor"
	    data-editor-xtext-lang="entities"
		data-editor-dirty-element="dirty-indicator"
		data-editor-enable-formatting-action="true"
		data-editor-content-assist-char-triggers="[.]"
		data-editor-content-assist-excluded-styles="(comment.*|string.*)"
	><pre>
import java.util.List

/*
 * A simple Entities example.
 */
package test {
	
	// This is my self-made entity
	entity MyEntity {
		myProperty : List&lt;String&gt;
		op myOperation() : String {
			myProperty.head
		}
	}
	
	entity Container {
		entities : List&lt;MyEntity&gt;
		op findMatching(String param) : MyEntity {
			entities.findFirst[myOperation == param]
		}
	}
	
}</pre></div>
	<div class="status-wrapper">
		<div id="dirty-indicator">modified</div>
		<div id="status">Welcome to Xtext-Web</div>
	</div>
</div>

</body>
</html>
